package org.ttitfly.workflow.engine.run;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * 任务
 * 
 * @author 潘海春
 * @version 2009-9-18
 */
@Entity
@Table(name = "WF_TASK")
public class Task extends WFEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/** 流程实例 */
	@ManyToOne
	@JoinColumn(name = "PROCESS_INSTANCE_ID")
	private ProcessInstance processInstance;

	/** 运行单元名称 */
	@Column(name = "UNIT_NAME")
	private String unitName;
	
	/** 之前执行的任务 */
	@ManyToOne
	@JoinColumn(name = "PREVIOUS_ID")
	private Task previous;

	/** 状态 */
	@Column(name = "STATUS")
	private int status;

	/** 激活时间 */
	@Column(name = "ACTIVATION_TIME")
	private Date activationTime;

	/** 关闭时间 */
	@Column(name = "CLOSE_TIME")
	private Date closeTime;

	/** 任务人 */
	@Column(name = "ASSIGNERS")
	private String assigners;

	/** 执行者 */
	@Column(name = "OPERATOR")
	private String operator;

	/** 执行方式 */
	@Column(name = "ACTION")
	private String action;
	
	/** 动作结果状态 */
	@Column(name = "ACTION_STATUS")
	private String actionStatus;
	
	/** 任务描述 */
	@Column(name = "DESCRIPTION")
	private String description;
	
	/** 操作备注 */
	@Column(name = "REMARK")
	private String remark;

	public ProcessInstance getProcessInstance() {
		return processInstance;
	}

	public void setProcessInstance(ProcessInstance processInstance) {
		this.processInstance = processInstance;
	}

	public String getUnitName() {
		return unitName;
	}

	public void setUnitName(String unitName) {
		this.unitName = unitName;
	}

	public Task getPrevious() {
		return previous;
	}

	public void setPrevious(Task previous) {
		this.previous = previous;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public Date getActivationTime() {
		return activationTime;
	}

	public void setActivationTime(Date activationTime) {
		this.activationTime = activationTime;
	}

	public Date getCloseTime() {
		return closeTime;
	}

	public void setCloseTime(Date closeTime) {
		this.closeTime = closeTime;
	}

	public String getAssigners() {
		return assigners;
	}

	public void setAssigners(String assigners) {
		this.assigners = assigners;
	}

	public String getOperator() {
		return operator;
	}

	public void setOperator(String operator) {
		this.operator = operator;
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}

	public String getActionStatus() {
		return actionStatus;
	}

	public void setActionStatus(String actionStatus) {
		this.actionStatus = actionStatus;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
	
}
